package com.btpj.shop.dto.param;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * goods 商品
 *
 * @author BTPJ
 */
@ApiModel("商品参数")
@Data
public class GoodsParam implements Serializable {
    @ApiModelProperty("名称")
    @Length(min = 1, max = 50, message = "商品名称必须在1～50个字符之间")
    private String name;

    @ApiModelProperty("商品简介描述")
    @Length(min = 1, max = 100, message = "商品简介必须在1～100个字符之间")
    private String description;

    @ApiModelProperty("商品分类ID")
    @NotNull
    private Long categoryId;

    @ApiModelProperty("商品图片")
    @NotBlank(message = "商品图片URL不可为空")
    private String imageUrl;

    @ApiModelProperty("详细内容")
    @NotBlank(message = "商品描述详情不可为空")
    private String detailContent;

    @ApiModelProperty("原始价格(分)）")
    @NotNull(message = "商品原始价格不可为空")
    private Long originalPrice;

    @ApiModelProperty("实际售价(分)")
    @NotNull(message = "商品实际售价不可为空")
    private Long sellingPrice;

    @ApiModelProperty("库存数量")
    @NotNull(message = "商品库存数量不可为空")
    private Integer stockNum;

    @ApiModelProperty("商品介绍关键词")
    @Length(min = 1, max = 50, message = "商品简介必须在1～50个字符之间")
    private String keywords;

    @ApiModelProperty("上架状态（0:上架 1:下架）")
    @Range(min = 0, max = 1, message = "商品上架状态必须取值0:上架 1:下架")
    private Byte sellStatus;

    private static final long serialVersionUID = 1L;
}